    /* global FormData */
    /* global getCookie */
    /* global raty */
 
    (function ($) {
        $('.eva').raty({ score: 5 }); 
        $('.eva').raty({
			click: function(score) {
				$('#evaluateLevel').val(score);
			}
		});

       
    })(jQuery);



    $("#evaluateContent").keyup(function() {
        var value = $.trim(this.value);
        var descLength = $.trim(this.value).length;
        if (descLength <= 200) { 
            $("#descNumber").html(descLength);
        } else {
            $("#evaluateContent").val(value.substring(0,200));
        }
    });

    function puilcPro(){
        var id = $("#orderId").val();
        var evaluateLevel = $("#evaluateLevel").val();
        
        var evaluateContent = $("#evaluateContent").val();
        

        if (evaluateLevel == ''){
            $.toast("请选择评价等级", "cancel");
            return;
        }
        if (evaluateContent == ''){
            $.toast("请填写评价内容", "cancel");
            return;
        }
        

        var params = {};
        params.id = id;
        params.evaluateLevel = evaluateLevel;
        params.evaluateContent = evaluateContent;
        
        params.token = getCookie('token');
        $.ajax({
            type:'POST',
            url:"/antique/api/mallOrder/user/order_evaluate",
            data: params,
            dataType:"json",
            success:function(res){
                if (res.code == 0){
                    $.toast("成功");
                    if(isMiniProgram()){
                        wx.miniProgram.navigateBack();
                    } else {
                        goPreUrl();
                    }
                 } else {
                    $.toast(res.message, "cancel");
                }
                
            }
        });
    } 

   
   


